#! /bin/sh

name=v
from_source=v
revision=1
imagedeps="build-essential"

build() {
    cp -rpf ${source_dir}/. ./
    set -x
    cc $HOST_CFLAGS $HOST_CPPFLAGS -w -std=gnu99 $HOST_LDFLAGS vc/v.c -lm -lpthread -o v
    set +x
}

package() {
    rm -rf "${dest_dir}${prefix}"/v
    mkdir -p "${dest_dir}${prefix}"/v
    cp -r . "${dest_dir}${prefix}"/v/
    rm -rf "${dest_dir}${prefix}"/v/.git

    mkdir -p "${dest_dir}${prefix}"/bin
    ln -sf ../v/v "${dest_dir}${prefix}"/bin/v

        strip_command=strip \
    post_package_strip
}
